﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="PersonCenter.aspx.cs" Inherits="WebApplication1.PersonCenter" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp;</p>
    <p>
        用户名：<asp:Label ID="lblUserName" runat="server"></asp:Label>
    </p>
    <p>
        邮箱：<asp:Label ID="lblemail" runat="server"></asp:Label>
    </p>
    <p>
        &nbsp;</p>
    <p>
        邮箱：<asp:TextBox ID="tbxchangeemail" runat="server"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="btnChangeEmail" runat="server" onclick="btnChangeEmail_Click" 
            Text="修改邮箱" />
    </p>
    <p>
        密码：<asp:TextBox ID="tbxPassword" runat="server" TextMode="Password"></asp:TextBox>
    </p>
    <p>
        重复密码：<asp:TextBox ID="tbxRePassword" runat="server" TextMode="Password"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="btnChangePassword" runat="server" 
            onclick="btnChangePassword_Click" Text="修改密码" />
    </p>
    <p>
        -------华丽丽的分割线,下面显示个人收藏-------<asp:Image ID="Image4" runat="server" />
        ------</p>
    <p>;
        <asp:Repeater ID="RepeaterFavourite" runat="server">
        <HeaderTemplate>
            <ul>
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <a href="ViewSchool.aspx?SchoolId=<%#Eval("Id") %>"><%#Eval("Name") %></a>
            </li>
            <li>
                <%#Eval("Address") %>
            </li>
            <li>
                <asp:LinkButton ID="lbtCollect" runat="server" CommandName="CancelFavourite" OnCommand="CancelFavourite_Command" CommandArgument='<%#Eval("Id")%>'>取消收藏
                </asp:LinkButton>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
        </asp:Repeater>
        <script type="text/javascript" language="javascript">
        function testEmailInput() {
            if (document.getElementById("MainContent_tbxchangeemail").value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
                alert("邮箱格式不正确");
                document.getElementById("MainContent_tbxchangeemail").focus();
                return false;
            }
            else {
                return true;
            }
            }
            function testPasswordInput() {
            if (document.getElementById("MainContent_tbxPassword").value.length < 6) {
                alert("密码长度至少为6位");
                document.getElementById("MainContent_tbxPassword").focus();
                return false;
            }
            if (document.getElementById("MainContent_tbxPassword").value != document.getElementById("MainContent_tbxRePassword").value) {
                alert("两次输入的密码不同");
                document.getElementById("MainContent_tbxRePassword").focus();
                return false;
            }
        }
        </script>
    </p>
    <br />
</asp:Content>
